package com.swfee.qinben.httpactions;

import java.util.List;

import com.swfee.qinben.dto.req.FamilyReqDto;
import com.swfee.qinben.dto.req.HealthMeasureDataReqDto;
import com.swfee.qinben.dto.req.MedicalHistoryReqDto;
import com.swfee.qinben.dto.rsp.FamilyRspDto;
import com.swfee.qinben.dto.rsp.HealthMeasureRspDto;
import com.swfee.qinben.dto.rsp.MedicalHistoryRspDto;
import com.swfee.qinben.httpactions.base.ReqBaseAction;
import com.swfee.qinben.session.UserSession;

public class FamilyAction extends ReqBaseAction<FamilyReqDto,FamilyRspDto> {

	
	public FamilyAction() {
		super();
		setDefaultRspClass(FamilyRspDto.class);
	}
	
	@Override
	public String getBaseActionUrl() {
		return "/webService/MedicalCare.CustomerServices/Family.asmx";
	}
	
	
	public FamilyRspDto getAFamily(Integer familyId){
		String actionName = "/GetAFamily";
		FamilyReqDto req = new FamilyReqDto();
		req.setFamilyId(familyId);
		return  doHttpForObject(req, actionName);
	}
	
	public FamilyRspDto getFamilyList(int pageNO,int pageSize){
		String actionName = "/GetAFamily";
		FamilyReqDto req = new FamilyReqDto();
		req.setPageIndex(pageNO);
		req.setPageSize(pageSize);
		req.setCustomerId(UserSession.getUserId());
		return  doHttpForObject(req, actionName);
	}

	
	public List<MedicalHistoryRspDto> getMedicalHistory(Integer familyId){
		MedicalHistoryReqDto req = new MedicalHistoryReqDto();
		req.setFamilyId(familyId);
		String actionName = "/GetMedicalHistory";
		 return  (List<MedicalHistoryRspDto>) doHttpForList(req, actionName,MedicalHistoryRspDto.class);
		
	}
	
	public HealthMeasureRspDto getHealthMeasureData(Integer scheduleId,Integer familyId){
		HealthMeasureDataReqDto req = new HealthMeasureDataReqDto();
		req.setFamilyId(familyId);
		req.setScheduleId(scheduleId);
		String actionName = "/GetHealthMeasureData";
		 return  (HealthMeasureRspDto) doHttpForObject(req, actionName,HealthMeasureRspDto.class);
		
	}
	
	
	 
	
	
	
}
